<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libschc: bit_operations.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">libschc
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">bit_operations.h File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
<code>#include &quot;<a class="el" href="schc_8h_source.html">schc.h</a>&quot;</code><br />
</div>
<p><a href="bit__operations_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a4c1e0708f6f9b121ca602cd8ceddd670"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a4c1e0708f6f9b121ca602cd8ceddd670">BYTES_TO_BITS</a>(x)&#160;&#160;&#160;(x * 8)</td></tr>
<tr class="separator:a4c1e0708f6f9b121ca602cd8ceddd670"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5eb6b4755b74c50cb76155d08b6e2ff"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#ac5eb6b4755b74c50cb76155d08b6e2ff">BITS_TO_BYTES</a>(x)&#160;&#160;&#160;(((x) == 0) ? 0 : (((x) - 1) / 8 + 1))</td></tr>
<tr class="separator:ac5eb6b4755b74c50cb76155d08b6e2ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a6ca8acc21387487f5a65244eee7657ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a6ca8acc21387487f5a65244eee7657ad">set_bits</a> (uint8_t A[], uint32_t pos, uint32_t len)</td></tr>
<tr class="memdesc:a6ca8acc21387487f5a65244eee7657ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">sets bits at a certain position in a bit array big endian  <a href="bit__operations_8h.html#a6ca8acc21387487f5a65244eee7657ad">More...</a><br /></td></tr>
<tr class="separator:a6ca8acc21387487f5a65244eee7657ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac145c54c244fb53f1fb266113f483d54"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#ac145c54c244fb53f1fb266113f483d54">get_bits</a> (const uint8_t A[], uint32_t pos, uint8_t len)</td></tr>
<tr class="memdesc:ac145c54c244fb53f1fb266113f483d54"><td class="mdescLeft">&#160;</td><td class="mdescRight">get bits at a certain position in a bit array  <a href="bit__operations_8h.html#ac145c54c244fb53f1fb266113f483d54">More...</a><br /></td></tr>
<tr class="separator:ac145c54c244fb53f1fb266113f483d54"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3821f50623047fb93ed4b820fd4a1b8a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a3821f50623047fb93ed4b820fd4a1b8a">clear_bits</a> (uint8_t A[], uint32_t pos, uint32_t len)</td></tr>
<tr class="memdesc:a3821f50623047fb93ed4b820fd4a1b8a"><td class="mdescLeft">&#160;</td><td class="mdescRight">clear bits at a certain position in a bit array big endian  <a href="bit__operations_8h.html#a3821f50623047fb93ed4b820fd4a1b8a">More...</a><br /></td></tr>
<tr class="separator:a3821f50623047fb93ed4b820fd4a1b8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa74d3f4edb3fbd2704f24343a2e50813"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#aa74d3f4edb3fbd2704f24343a2e50813">copy_bits</a> (uint8_t DST[], uint32_t dst_pos, const uint8_t SRC[], uint32_t src_pos, uint32_t len)</td></tr>
<tr class="memdesc:aa74d3f4edb3fbd2704f24343a2e50813"><td class="mdescLeft">&#160;</td><td class="mdescRight">copy bits to a certain position in a bit array from another array big endian  <a href="bit__operations_8h.html#aa74d3f4edb3fbd2704f24343a2e50813">More...</a><br /></td></tr>
<tr class="separator:aa74d3f4edb3fbd2704f24343a2e50813"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9dfca8d34f44271dd48ef2c3be2f0092"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a9dfca8d34f44271dd48ef2c3be2f0092">compare_bits</a> (const uint8_t SRC1[], const uint8_t SRC2[], uint32_t len)</td></tr>
<tr class="memdesc:a9dfca8d34f44271dd48ef2c3be2f0092"><td class="mdescLeft">&#160;</td><td class="mdescRight">compare two bit arrays  <a href="bit__operations_8h.html#a9dfca8d34f44271dd48ef2c3be2f0092">More...</a><br /></td></tr>
<tr class="separator:a9dfca8d34f44271dd48ef2c3be2f0092"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8e148c4d5810b49b365e71a7ef7337e7"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a8e148c4d5810b49b365e71a7ef7337e7">compare_bits_aligned</a> (const uint8_t SRC1[], uint16_t pos1, const uint8_t SRC2[], uint16_t pos2, uint32_t len)</td></tr>
<tr class="memdesc:a8e148c4d5810b49b365e71a7ef7337e7"><td class="mdescLeft">&#160;</td><td class="mdescRight">compare two bit arrays with starting point  <a href="bit__operations_8h.html#a8e148c4d5810b49b365e71a7ef7337e7">More...</a><br /></td></tr>
<tr class="separator:a8e148c4d5810b49b365e71a7ef7337e7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac419537c6b944dac4508bb2535e1b633"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#ac419537c6b944dac4508bb2535e1b633">compare_bits_BIG_END</a> (uint8_t SRC1[], uint8_t SRC2[], uint32_t len)</td></tr>
<tr class="separator:ac419537c6b944dac4508bb2535e1b633"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6ebd634daa417f0d054b15983d0703af"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a6ebd634daa417f0d054b15983d0703af">shift_bits_left</a> (uint8_t SRC[], uint16_t len, uint32_t shift)</td></tr>
<tr class="memdesc:a6ebd634daa417f0d054b15983d0703af"><td class="mdescLeft">&#160;</td><td class="mdescRight">shift a number of bits to the left  <a href="bit__operations_8h.html#a6ebd634daa417f0d054b15983d0703af">More...</a><br /></td></tr>
<tr class="separator:a6ebd634daa417f0d054b15983d0703af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afadff313aab0bbe2ed79ce72885735c3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#afadff313aab0bbe2ed79ce72885735c3">shift_bits_right</a> (uint8_t SRC[], uint16_t len, uint32_t shift)</td></tr>
<tr class="memdesc:afadff313aab0bbe2ed79ce72885735c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">shift a number of bits to the right  <a href="bit__operations_8h.html#afadff313aab0bbe2ed79ce72885735c3">More...</a><br /></td></tr>
<tr class="separator:afadff313aab0bbe2ed79ce72885735c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9858cf5fc58daff568ba07a5d264989d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a9858cf5fc58daff568ba07a5d264989d">xor_bits</a> (uint8_t DST[], uint8_t SRC1[], uint8_t SRC2[], uint32_t len)</td></tr>
<tr class="memdesc:a9858cf5fc58daff568ba07a5d264989d"><td class="mdescLeft">&#160;</td><td class="mdescRight">logical XOR two bit arrays  <a href="bit__operations_8h.html#a9858cf5fc58daff568ba07a5d264989d">More...</a><br /></td></tr>
<tr class="separator:a9858cf5fc58daff568ba07a5d264989d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e6bd75bf5871176bb38d7e382372f28"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a5e6bd75bf5871176bb38d7e382372f28">and_bits</a> (uint8_t DST[], uint8_t SRC1[], uint8_t SRC2[], uint32_t len)</td></tr>
<tr class="memdesc:a5e6bd75bf5871176bb38d7e382372f28"><td class="mdescLeft">&#160;</td><td class="mdescRight">logical AND two bit arrays  <a href="bit__operations_8h.html#a5e6bd75bf5871176bb38d7e382372f28">More...</a><br /></td></tr>
<tr class="separator:a5e6bd75bf5871176bb38d7e382372f28"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a963c3f1e2f40087703e826a454198faa"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a963c3f1e2f40087703e826a454198faa">print_bitmap</a> (const uint8_t bitmap[], uint32_t length)</td></tr>
<tr class="memdesc:a963c3f1e2f40087703e826a454198faa"><td class="mdescLeft">&#160;</td><td class="mdescRight">print a bitmap  <a href="bit__operations_8h.html#a963c3f1e2f40087703e826a454198faa">More...</a><br /></td></tr>
<tr class="separator:a963c3f1e2f40087703e826a454198faa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a56ab5e62da3e4cde30d216b7e0b53b2a"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a56ab5e62da3e4cde30d216b7e0b53b2a">get_number_of_bytes_from_bits</a> (uint16_t number_of_bits)</td></tr>
<tr class="memdesc:a56ab5e62da3e4cde30d216b7e0b53b2a"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the number of bytes required to store this amount of bits  <a href="bit__operations_8h.html#a56ab5e62da3e4cde30d216b7e0b53b2a">More...</a><br /></td></tr>
<tr class="separator:a56ab5e62da3e4cde30d216b7e0b53b2a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a908d1e823f59e9d52bb7eec00e666959"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a908d1e823f59e9d52bb7eec00e666959">get_required_number_of_bits</a> (uint32_t value)</td></tr>
<tr class="memdesc:a908d1e823f59e9d52bb7eec00e666959"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the number of bits required to store a value  <a href="bit__operations_8h.html#a908d1e823f59e9d52bb7eec00e666959">More...</a><br /></td></tr>
<tr class="separator:a908d1e823f59e9d52bb7eec00e666959"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a43ead7431c1b8bd21806927b306fb7fd"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#a43ead7431c1b8bd21806927b306fb7fd">get_position_in_first_byte</a> (uint8_t value)</td></tr>
<tr class="memdesc:a43ead7431c1b8bd21806927b306fb7fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">get the starting bit of a value  <a href="bit__operations_8h.html#a43ead7431c1b8bd21806927b306fb7fd">More...</a><br /></td></tr>
<tr class="separator:a43ead7431c1b8bd21806927b306fb7fd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afa77e854f2ae60f5126d75270d28a059"><td class="memItemLeft" align="right" valign="top">uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="bit__operations_8h.html#afa77e854f2ae60f5126d75270d28a059">padded</a> (<a class="el" href="structschc__bitarray__t.html">schc_bitarray_t</a> *bit_array)</td></tr>
<tr class="memdesc:afa77e854f2ae60f5126d75270d28a059"><td class="mdescLeft">&#160;</td><td class="mdescRight">remove padding  <a href="bit__operations_8h.html#afa77e854f2ae60f5126d75270d28a059">More...</a><br /></td></tr>
<tr class="separator:afa77e854f2ae60f5126d75270d28a059"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ac5eb6b4755b74c50cb76155d08b6e2ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5eb6b4755b74c50cb76155d08b6e2ff">&#9670;&nbsp;</a></span>BITS_TO_BYTES</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BITS_TO_BYTES</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;(((x) == 0) ? 0 : (((x) - 1) / 8 + 1))</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="a4c1e0708f6f9b121ca602cd8ceddd670"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4c1e0708f6f9b121ca602cd8ceddd670">&#9670;&nbsp;</a></span>BYTES_TO_BITS</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define BYTES_TO_BITS</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">x</td><td>)</td>
          <td>&#160;&#160;&#160;(x * 8)</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a5e6bd75bf5871176bb38d7e382372f28"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e6bd75bf5871176bb38d7e382372f28">&#9670;&nbsp;</a></span>and_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void and_bits </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>DST</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC1</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC2</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>logical AND two bit arrays </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DST</td><td>the array to save the result in </td></tr>
    <tr><td class="paramname">SRC1</td><td>the array to compare with </td></tr>
    <tr><td class="paramname">SRC2</td><td>the array to compare with </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to compare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a3821f50623047fb93ed4b820fd4a1b8a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3821f50623047fb93ed4b820fd4a1b8a">&#9670;&nbsp;</a></span>clear_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void clear_bits </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>A</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>clear bits at a certain position in a bit array big endian </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">A</td><td>the bit array </td></tr>
    <tr><td class="paramname">pos</td><td>which bit to clear </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to clear </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9dfca8d34f44271dd48ef2c3be2f0092"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9dfca8d34f44271dd48ef2c3be2f0092">&#9670;&nbsp;</a></span>compare_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t compare_bits </td>
          <td>(</td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>SRC1</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>SRC2</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>compare two bit arrays </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">SRC1</td><td>the array to compare </td></tr>
    <tr><td class="paramname">SRC2</td><td>the array to compare with </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to compare</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 both arrays match 0 the arrays differ </dd></dl>

</div>
</div>
<a id="a8e148c4d5810b49b365e71a7ef7337e7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8e148c4d5810b49b365e71a7ef7337e7">&#9670;&nbsp;</a></span>compare_bits_aligned()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t compare_bits_aligned </td>
          <td>(</td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>SRC1</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>pos1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>SRC2</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>pos2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>compare two bit arrays with starting point </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">SRC1</td><td>the array to compare </td></tr>
    <tr><td class="paramname">pos1</td><td>position to start for src1 </td></tr>
    <tr><td class="paramname">SRC2</td><td>the array to compare with </td></tr>
    <tr><td class="paramname">pos2</td><td>position to start for src2 </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to compare</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 both arrays match 0 the arrays differ </dd></dl>

</div>
</div>
<a id="ac419537c6b944dac4508bb2535e1b633"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac419537c6b944dac4508bb2535e1b633">&#9670;&nbsp;</a></span>compare_bits_BIG_END()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t compare_bits_BIG_END </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC1</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC2</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="aa74d3f4edb3fbd2704f24343a2e50813"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa74d3f4edb3fbd2704f24343a2e50813">&#9670;&nbsp;</a></span>copy_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void copy_bits </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>DST</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>dst_pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>SRC</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>src_pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>copy bits to a certain position in a bit array from another array big endian </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DST</td><td>the array to copy to </td></tr>
    <tr><td class="paramname">dst_pos</td><td>which bit to start from </td></tr>
    <tr><td class="paramname">SRC</td><td>the array to copy from </td></tr>
    <tr><td class="paramname">src_pos</td><td>which bit to start from </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to set </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ac145c54c244fb53f1fb266113f483d54"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac145c54c244fb53f1fb266113f483d54">&#9670;&nbsp;</a></span>get_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t get_bits </td>
          <td>(</td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>A</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get bits at a certain position in a bit array </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">A</td><td>the bit array </td></tr>
    <tr><td class="paramname">pos</td><td>the position to start from </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to get</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>limited to 32 consecutive bits </dd></dl>

</div>
</div>
<a id="a56ab5e62da3e4cde30d216b7e0b53b2a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a56ab5e62da3e4cde30d216b7e0b53b2a">&#9670;&nbsp;</a></span>get_number_of_bytes_from_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t get_number_of_bytes_from_bits </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>number_of_bits</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the number of bytes required to store this amount of bits </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">number_of_bits</td><td>the number of bits to find the number of bytes for </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a43ead7431c1b8bd21806927b306fb7fd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a43ead7431c1b8bd21806927b306fb7fd">&#9670;&nbsp;</a></span>get_position_in_first_byte()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t get_position_in_first_byte </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the starting bit of a value </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>the value to count the number of bits for </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a908d1e823f59e9d52bb7eec00e666959"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a908d1e823f59e9d52bb7eec00e666959">&#9670;&nbsp;</a></span>get_required_number_of_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t get_required_number_of_bits </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>get the number of bits required to store a value </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>the value to count the number of bits for </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="afa77e854f2ae60f5126d75270d28a059"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afa77e854f2ae60f5126d75270d28a059">&#9670;&nbsp;</a></span>padded()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8_t padded </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structschc__bitarray__t.html">schc_bitarray_t</a> *&#160;</td>
          <td class="paramname"><em>bit_array</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>remove padding </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bit_arr</td><td>the bit array to remove padding for</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>1 remove the last byte 0 word aligned </dd></dl>

</div>
</div>
<a id="a963c3f1e2f40087703e826a454198faa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a963c3f1e2f40087703e826a454198faa">&#9670;&nbsp;</a></span>print_bitmap()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void print_bitmap </td>
          <td>(</td>
          <td class="paramtype">const uint8_t&#160;</td>
          <td class="paramname"><em>bitmap</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>length</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>print a bitmap </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">bitmap</td><td>the bit array </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to print </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6ca8acc21387487f5a65244eee7657ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ca8acc21387487f5a65244eee7657ad">&#9670;&nbsp;</a></span>set_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void set_bits </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>A</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>sets bits at a certain position in a bit array big endian </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">A</td><td>the bit array </td></tr>
    <tr><td class="paramname">pos</td><td>which bit to set </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to set </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a6ebd634daa417f0d054b15983d0703af"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6ebd634daa417f0d054b15983d0703af">&#9670;&nbsp;</a></span>shift_bits_left()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void shift_bits_left </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>shift</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>shift a number of bits to the left </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">SRC</td><td>the array to shift </td></tr>
    <tr><td class="paramname">len</td><td>the length of the array </td></tr>
    <tr><td class="paramname">shift</td><td>the number of consecutive bits to shift </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="afadff313aab0bbe2ed79ce72885735c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afadff313aab0bbe2ed79ce72885735c3">&#9670;&nbsp;</a></span>shift_bits_right()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void shift_bits_right </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>len</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>shift</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>shift a number of bits to the right </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">SRC</td><td>the array to shift </td></tr>
    <tr><td class="paramname">len</td><td>the length of the array </td></tr>
    <tr><td class="paramname">shift</td><td>the number of consecutive bits to shift </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9858cf5fc58daff568ba07a5d264989d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9858cf5fc58daff568ba07a5d264989d">&#9670;&nbsp;</a></span>xor_bits()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void xor_bits </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>DST</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC1</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>SRC2</em>[], </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>logical XOR two bit arrays </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">DST</td><td>the array to save the result in </td></tr>
    <tr><td class="paramname">SRC1</td><td>the array to compare with </td></tr>
    <tr><td class="paramname">SRC2</td><td>the array to compare with </td></tr>
    <tr><td class="paramname">len</td><td>the number of consecutive bits to compare </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
